<?php
/**
 * Created by PhpStorm.
 * User: sqq
 * Date: 2018/05/24
 * Time: 上午11:45
 */
class KingGloryLoss extends Eloquent
{
    protected $primaryKey = 'id';
    protected $table = "kingglory_loss";

    public static function InsertLoss($anchors,$source,$team_id,$type){
        $loss = New KingGloryLoss();
        $loss->anchors = $anchors;
        $loss->source = $source;
        $loss->team_id = $team_id;
        $loss->type = $type;
        $loss->created_at=date("Y-m-d H:i:s",time());
        $loss->updated_at=date("Y-m-d H:i:s",time());
        $loss->save();
        $num_loss = KingGloryLossCount::where("anchors",$anchors)->where("source",$source)->where("team_id",$team_id)->first();
        return $num_loss;
    }
}